#include "mythread.h"
#include <QDebug>
QMutex MyThread::mutex;
int MyThread::num = 0;

MyThread::MyThread(QObject* parent) : QThread(parent)
{

}

void MyThread::run()
{
    while (1) {

            QMutexLocker locker(&mutex);
            qDebug() << this <<" : " << this->num++;

            QThread::sleep(1);
    }
}
